<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var arr=[1,2,3,2,1]
    function dc(arr){
        var a= arr.join('')
        var brr=arr.reverse()
        var b = brr.join('')
        var c= b==a? true: false
        return c;
    }
    document.write(dc(arr))
</script>